<template>
    <div class="box">
        <el-row>
            <el-col :span="22" :push="1">
                <div class="grid-content bg-purple" style="height: 77px">
                    <span style="line-height: 77px; font-size: 14px"> </span>
                    <span style="margin-left: 20px">
                        <el-button type="primary" @click="skip">添加印章</el-button>
                    </span>
                </div>
            </el-col>
        </el-row>
        <!-- 搜索栏start -->
        <el-row>
            <el-col :span="22" :push="1">
                <div class="grid-content bg-purple">
                    <span style="margin-left: 20px;">
                        <el-form ref="form" :inline="true" :model="form" label-width="80px">
                            <el-form-item label="印章管理">
                                <el-input l v-model="form.name" placeholder="请输入名称"></el-input>
                            </el-form-item>
                            <el-form-item label="责任人">
                                <el-input v-model="form.name" placeholder="请输入内容"></el-input>
                            </el-form-item>
                            <el-form-item label="状态">
                                <el-select v-model="form.region" placeholder="请选择">
                                    <el-option label="全部" value="shanghai"></el-option>
                                    <el-option label="已借出" value="beijing"></el-option>
                                    <el-option label="未借出" value="beijing"></el-option>
                                    <el-option label="已封存" value="beijing"></el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item label="创建日期">
                                <el-date-picker v-model="form.value1" type="date" placeholder="选择日期">

                                </el-date-picker>
                            </el-form-item>
                            <el-form-item>
                                <el-button type="primary" @click="onSubmit">搜索</el-button>
                                <el-button @click="reset()">重置</el-button>
                            </el-form-item>
                        </el-form>
                    </span>
                </div>
            </el-col>
        </el-row>
        <!-- 搜索栏end -->
        <!-- 表格 -->
        <el-row>
            <el-col :span="22" :push="1">
                <div class="grid-content bg-purple">
                    <span style="padding-left: 10px">
                        <el-table :data="tableData" border style="width: 96.5%; margin-left: 20px">
                            <el-table-column prop="id" label="印章名称" width="120">
                            </el-table-column>
                            <el-table-column prop="name" label="责任人" width="230">
                            </el-table-column>
                            <el-table-column prop="roleDescribe" label="状态" width="510">
                            </el-table-column>
                            <el-table-column prop="userRoleCount" label="注释" width="140">
                            </el-table-column>
                            <el-table-column prop="userRoleCount" label="创建时间" width="140">
                            </el-table-column>
                            <el-table-column label="操作" width="140">
                                <template slot-scope="scope">
                                    <el-button @click="handleClick(scope.row)" type="text" size="small">删除</el-button>
                                    <el-button @click="handleClick(scope.row)" type="text" size="small">修改</el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                        <div class="grid-content bg-purple-dark">
                            <div class="block">
                                <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                                    :current-page="pageNum" :page-sizes="[5, 10, 20, 50]" :page-size="pageSize"
                                    layout="total, sizes, prev, pager, next, jumper" :total="total">
                                </el-pagination>
                            </div>
                        </div>
                    </span>
                </div>
            </el-col>
        </el-row>
    </div>
</template>

<script>
import axios from 'axios';
export default {
    data() {
        return {
            form: [],
            tableData: [],
            pageNum: 1,
            pageSize: 5,
            total: 1,
        }
    },
    created() { },
    methods: {
        //获取印章信息
        getSeal() {
            axios("/seal/getSeal?pageSize=" + this.pageSize + "&pageNum=" + this.pageNum, this.form).then((res) => {
                console.log(res);
            })
        },
        //搜索
        onSubmit() {

        },
        // 重置
        reset() {
            this.form = []
        },
        skip() {

        },
        //每页条数改变时触发 选择一页显示多少行
        handleSizeChange(val) {
            this.pageSize = val;
            this.getRole();
        },
        //当前页改变时触发 跳转其他页
        handleCurrentChange(val) {
            this.pageNum = val;
            this.getRole();
        },
    }
};
</script>

<style scoped>
/* element-ui样式 */
.el-row {
    margin-bottom: 10px;

    &:last-child {
        margin-bottom: 0;
    }
}

.el-col {
    border-radius: 4px;
}

.bg-purple {
    background: #fff;
    border-radius: 10px;
}

/* 自定义样式 */
.box {
    width: 98%;
    height: 100%;
    margin: auto;
    /* background-color: red; */
}

.block {
    padding-top: 10px;
    padding-left: 750px;
}
</style>